package masterjava.common.util;

import masterjava.common.logging.MasterLogger;

import java.io.IOException;
import java.util.Properties;

/**
 * MasterJava.ru
 * <p/>
 * User: GKislin
 * Date: 15.04.11
 *
 * extended Properties
 */
public class MasterProperties extends Properties {

    protected static final MasterLogger LOGGER = MasterLogger.get(MasterProperties.class);

    public MasterProperties(String fileName) {
        load(fileName);
    }

    public void load(String fileName) {
        try {
            load(IOUtil.getResourceAsReader(fileName));
        } catch (IOException e) {
            throw LOGGER.getIllegalArgumentException(String.format("Properties file '%s' read error", fileName), e);
        }
    }
}
